import {ecInstance} from '@/utils/request'
import {cartAddGoods,cartGetCartNum,wxsign} from '@/types/reqtypes'
export function Warning(){
    return ecInstance.get("/index.php/openapi/wap_app_setting/warning")
    .then(data => [true, data])
    .catch(err => [false,err])
}
export function addCart(params: cartAddGoods){
    return ecInstance.post("/wap/cart-add-goods.html",
        params
    ).then(data => [true, data])
    .catch(err => [false,err])
}
export function getCartNum(params:cartGetCartNum){
    return ecInstance.post("/wap/cart-getCartNum.html",params)
    .then(data => [true, data])
    .catch(err => [false,err])
}
export function getwxsign(params:wxsign){
    return ecInstance.post("/wap/cart-getWeixintooken_weidian.html",params)
    .then(data => [true, data])
    .catch(err => [false,err])
}